*Table 6: Meal and Snack treatment effects on children’s incentivized food preferences	
cd ""

use "master_data_adults_child_s13456_shared.dta", clear 
*drop _merge
joinby id hh_id using "demog_adults_edi_essex_shared.dta", unmatched(both)

**having gender for children for every session line
egen gendermax=max(gender), by(id_nb)
ge sex=(gendermax==1) 
replace sex=. if gendermax==.
drop _merge
joinby id  using "children tasks EDIN and ESSEX year 3 tasks 1 to 3 STATA_shared.dta", unmatched(both)
drop _merge
joinby id   using "children incentivized task EDIN and ESSEX year 3_shared.dta", unmatched(both)
drop _merge

**keeping only children and year 3 (session 6)
keep if child==1
keep if session==6

*Create Table 6
reg n_unhealthy i.treatment 
reg n_unhealthy i.treatment capsules_chosen 
reg n_unhealthy i.treatment capsules_chosen i.sex yearofbirth




